package com.app.service.impl;

import com.app.mapper.akesai.*;
import com.app.mapper.dunhuang.*;
import com.app.mapper.guazhou.*;
import com.app.mapper.jinta.*;
import com.app.mapper.subei.*;
import com.app.mapper.suzhou.*;
import com.app.mapper.yumen.*;
import com.app.model.*;
import com.app.service.StatisticsService;
import com.app.util.StringTool;
import com.app.vo.DataVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class StatisticsServiceImpl implements StatisticsService {
    @Autowired
    private ComRecruitersSuzhouMapper comRecruitersSuzhouMapper;
    @Autowired
    private ComRecruitersJintaMapper comRecruitersJintaMapper;
    @Autowired
    private ComRecruitersDunhuangMapper comRecruitersDunhuangMapper;
    @Autowired
    private ComRecruitersGuazhouMapper comRecruitersGuazhouMapper;
    @Autowired
    private ComRecruitersYumenMapper comRecruitersYumenMapper;
    @Autowired
    private ComRecruitersSubeiMapper comRecruitersSubeiMapper;
    @Autowired
    private ComRecruitersAkesaiMapper comRecruitersAkesaiMapper;


    @Autowired
    private JobPublishSuzhouMapper jobPublishSuzhouMapper;
    @Autowired
    private JobPublishJintaMapper jobPublishJintaMapper;
    @Autowired
    private JobPublishDunhuangMapper jobPublishDunhuangMapper;
    @Autowired
    private JobPublishGuazhouMapper jobPublishGuazhouMapper;
    @Autowired
    private JobPublishYumenMapper jobPublishYumenMapper;
    @Autowired
    private JobPublishSubeiMapper jobPublishSubeiMapper;
    @Autowired
    private JobPublishAkesaiMapper jobPublishAkesaiMapper;

    @Autowired
    private WorkApplySuzhouMapper workApplySuzhouMapper;
    @Autowired
    private WorkApplyJintaMapper workApplyJintaMapper;
    @Autowired
    private WorkApplyDunhuangMapper workApplyDunhuangMapper;
    @Autowired
    private WorkApplyGuazhouMapper workApplyGuazhouMapper;
    @Autowired
    private WorkApplyYumenMapper workApplyYumenMapper;
    @Autowired
    private WorkApplySubeiMapper workApplySubeiMapper;
    @Autowired
    private WorkApplyAkesaiMapper workApplyAkesaiMapper;

    @Autowired
    private EnterpriseSuzhouMapper enterpriseSuzhouMapper;
    @Autowired
    private EnterpriseJintaMapper enterpriseJintaMapper;
    @Autowired
    private EnterpriseDunhuangMapper enterpriseDunhuangMapper;
    @Autowired
    private EnterpriseGuazhouMapper enterpriseGuazhouMapper;
    @Autowired
    private EnterpriseYumenMapper enterpriseYumenMapper;
    @Autowired
    private EnterpriseSubeiMapper enterpriseSubeiMapper;
    @Autowired
    private EnterpriseAkesaiMapper enterpriseAkesaiMapper;

    @Autowired
    private NewsSuzhouMapper newsSuzhouMapper;
    @Autowired
    private NewsJintaMapper newsJintaMapper;
    @Autowired
    private NewsDunhuangMapper newsDunhuangMapper;
    @Autowired
    private NewsGuazhouMapper newsGuazhouMapper;
    @Autowired
    private NewsYumenMapper newsYumenMapper;
    @Autowired
    private NewsSubeiMapper newsSubeiMapper;
    @Autowired
    private NewsAkesaiMapper newsAkesaiMapper;

    @Autowired
    private JobFairSceneSuzhouMapper jobFairSceneSuzhouMapper;
    @Autowired
    private JobFairSceneJintaMapper jobFairSceneJintaMapper;
    @Autowired
    private JobFairSceneDunhuangMapper jobFairSceneDunhuangMapper;
    @Autowired
    private JobFairSceneGuazhouMapper jobFairSceneGuazhouMapper;
    @Autowired
    private JobFairSceneYumenMapper jobFairSceneYumenMapper;
    @Autowired
    private JobFairSceneSubeiMapper jobFairSceneSubeiMapper;
    @Autowired
    private JobFairSceneAkesaiMapper jobFairSceneAkesaiMapper;

    @Autowired
    private UserSuzhouMapper userSuzhouMapper;
    @Autowired
    private UserJintaMapper userJintaMapper;
    @Autowired
    private UserDunhuangMapper userDunhuangMapper;
    @Autowired
    private UserGuazhouMapper userGuazhouMapper;
    @Autowired
    private UserYumenMapper userYumenMapper;
    @Autowired
    private UserSubeiMapper userSubeiMapper;
    @Autowired
    private UserAkesaiMapper userAkesaiMapper;

    @Autowired
    private CustomerSuzhouMapper customerSuzhouMapper;
    @Autowired
    private CustomerJintaMapper customerJintaMapper;
    @Autowired
    private CustomerDunhuangMapper customerDunhuangMapper;
    @Autowired
    private CustomerGuazhouMapper customerGuazhouMapper;
    @Autowired
    private CustomerYumenMapper customerYumenMapper;
    @Autowired
    private CustomerSubeiMapper customerSubeiMapper;
    @Autowired
    private CustomerAkesaiMapper customerAkesaiMapper;

    @Autowired
    private BrowseNumberSuzhouMapper browseNumberSuzhouMapper;
    @Autowired
    private BrowseNumberJintaMapper browseNumberJintaMapper;
    @Autowired
    private BrowseNumberDunhuangMapper browseNumberDunhuangMapper;
    @Autowired
    private BrowseNumberGuazhouMapper browseNumberGuazhouMapper;
    @Autowired
    private BrowseNumberYumenMapper browseNumberYumenMapper;
    @Autowired
    private BrowseNumberSubeiMapper browseNumberSubeiMapper;
    @Autowired
    private BrowseNumberAkesaiMapper browseNumberAkesaiMapper;

    @Override
    public int getCountByGroup(String startTime, String endTime, Integer type) {
        QueryWrapper<EnterpriseModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("DISTINCT id");
        Integer count1 = enterpriseSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = enterpriseJintaMapper.selectCount(queryWrapper);
        Integer count3 = enterpriseDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = enterpriseGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = enterpriseYumenMapper.selectCount(queryWrapper);
        Integer count6 = enterpriseSubeiMapper.selectCount(queryWrapper);
        Integer count7 = enterpriseAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }



    @Override
    public int sumJobNumberAll(String startTime, String endTime, Integer type) {
        QueryWrapper<JobPublishModel> queryWrapper = new QueryWrapper<>();
        if (type == 1) {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('" + startTime + "')");
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('" + endTime + "')");
        }
        queryWrapper.select("sum(job_number) as sumAll");
        JobPublishModel model1 = jobPublishSuzhouMapper.selectOne(queryWrapper);
        JobPublishModel model2 = jobPublishJintaMapper.selectOne(queryWrapper);
        JobPublishModel model3 = jobPublishDunhuangMapper.selectOne(queryWrapper);
        JobPublishModel model4 = jobPublishGuazhouMapper.selectOne(queryWrapper);
        JobPublishModel model5 = jobPublishYumenMapper.selectOne(queryWrapper);
        JobPublishModel model6 = jobPublishSubeiMapper.selectOne(queryWrapper);
        JobPublishModel model7 = jobPublishAkesaiMapper.selectOne(queryWrapper);
        int sum = 0;
        if (model1 != null) {
            sum += model1.getSumAll();
        }
        if (model2 != null) {
            sum += model2.getSumAll();
        }
        if (model3 != null) {
            sum += model3.getSumAll();
        }
        if (model4 != null) {
            sum += model4.getSumAll();
        }
        if (model5 != null) {
            sum += model5.getSumAll();
        }
        if (model6 != null) {
            sum += model6.getSumAll();
        }
        if (model7 != null) {
            sum += model7.getSumAll();
        }
        return sum;
    }

    @Override
    public int getBrowseCount(String startTime, String endTime, Integer type) {
        QueryWrapper<BrowseNumberModel> queryWrapper = new QueryWrapper<>();
        if (type == 1) {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('" + startTime + "')");
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('" + endTime + "')");
        }
        queryWrapper.select().orderByDesc("id");
        Integer count1 = browseNumberSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = browseNumberJintaMapper.selectCount(queryWrapper);
        Integer count3 = browseNumberDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = browseNumberGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = browseNumberYumenMapper.selectCount(queryWrapper);
        Integer count6 = browseNumberSubeiMapper.selectCount(queryWrapper);
        Integer count7 = browseNumberAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getModelCountByTime(String crtTime, String startTime, String endTime, Integer type) {
        QueryWrapper<CustomerModel> queryWrapper = new QueryWrapper<>();
        if (type == 1) {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('" + startTime + "')");
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('" + endTime + "')");
        }
        Integer count1 = customerSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = customerJintaMapper.selectCount(queryWrapper);
        Integer count3 = customerDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = customerGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = customerYumenMapper.selectCount(queryWrapper);
        Integer count6 = customerSubeiMapper.selectCount(queryWrapper);
        Integer count7 = customerAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getModelCount(Integer type) {
        QueryWrapper<EnterpriseModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("state", type);
        Integer count1 = enterpriseSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = enterpriseJintaMapper.selectCount(queryWrapper);
        Integer count3 = enterpriseDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = enterpriseGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = enterpriseYumenMapper.selectCount(queryWrapper);
        Integer count6 = enterpriseSubeiMapper.selectCount(queryWrapper);
        Integer count7 = enterpriseAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getWorkAppCount(String startTime, String endTime, Integer type) {
        QueryWrapper<WorkApplyModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("distinct publish_id");
        if (type == 1) {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('" + startTime + "')");
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('" + endTime + "')");
        }
        Integer count1 = workApplySuzhouMapper.selectCount(queryWrapper);
        Integer count2 = workApplyJintaMapper.selectCount(queryWrapper);
        Integer count3 = workApplyDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = workApplyGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = workApplyYumenMapper.selectCount(queryWrapper);
        Integer count6 = workApplySubeiMapper.selectCount(queryWrapper);
        Integer count7 = workApplyAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int countWait() {
        QueryWrapper<JobPublishModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("recruit_state", 1);
        Integer count1 = jobPublishSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = jobPublishJintaMapper.selectCount(queryWrapper);
        Integer count3 = jobPublishDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = jobPublishGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = jobPublishYumenMapper.selectCount(queryWrapper);
        Integer count6 = jobPublishSubeiMapper.selectCount(queryWrapper);
        Integer count7 = jobPublishAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getNosUserCount() {
        QueryWrapper<UserModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("r_register_state", 3);
        Integer count1 = userSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = userJintaMapper.selectCount(queryWrapper);
        Integer count3 = userDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = userGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = userYumenMapper.selectCount(queryWrapper);
        Integer count6 = userSubeiMapper.selectCount(queryWrapper);
        Integer count7 = userAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getJobFairCount() {
        Integer count1 = jobFairSceneSuzhouMapper.selectCount(null);
        Integer count2 = jobFairSceneJintaMapper.selectCount(null);
        Integer count3 = jobFairSceneDunhuangMapper.selectCount(null);
        Integer count4 = jobFairSceneGuazhouMapper.selectCount(null);
        Integer count5 = jobFairSceneYumenMapper.selectCount(null);
        Integer count6 = jobFairSceneSubeiMapper.selectCount(null);
        Integer count7 = jobFairSceneAkesaiMapper.selectCount(null);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getNewsCount() {
        Integer count1 = newsSuzhouMapper.selectCount(null);
        Integer count2 = newsJintaMapper.selectCount(null);
        Integer count3 = newsDunhuangMapper.selectCount(null);
        Integer count4 = newsGuazhouMapper.selectCount(null);
        Integer count5 = newsYumenMapper.selectCount(null);
        Integer count6 = newsSubeiMapper.selectCount(null);
        Integer count7 = newsAkesaiMapper.selectCount(null);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }


    @Override
    public int getComRecruitersCount() {
        Integer count1 = comRecruitersSuzhouMapper.selectCount(null);
        Integer count2 = comRecruitersJintaMapper.selectCount(null);
        Integer count3 = comRecruitersDunhuangMapper.selectCount(null);
        Integer count4 = comRecruitersGuazhouMapper.selectCount(null);
        Integer count5 = comRecruitersYumenMapper.selectCount(null);
        Integer count6 = comRecruitersSubeiMapper.selectCount(null);
        Integer count7 = comRecruitersAkesaiMapper.selectCount(null);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getCountByTime(String time) {
        QueryWrapper<JobPublishModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.apply("TO_DAYS(crt_time) = TO_DAYS('" + time + "')");
        Integer count1 = jobPublishSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = jobPublishJintaMapper.selectCount(queryWrapper);
        Integer count3 = jobPublishDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = jobPublishGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = jobPublishYumenMapper.selectCount(queryWrapper);
        Integer count6 = jobPublishSubeiMapper.selectCount(queryWrapper);
        Integer count7 = jobPublishAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getCustomerCountByTime(String crtTime, String startTime, String endTime, Integer type) {
        QueryWrapper<CustomerModel> queryWrapper = new QueryWrapper();
        if (type == 1) {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('" + startTime + "')");
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('" + endTime + "')");
        } else {
            queryWrapper.apply("TO_DAYS(crt_time) > TO_DAYS('" + crtTime + "')");
        }
        Integer count1 = customerSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = customerJintaMapper.selectCount(queryWrapper);
        Integer count3 = customerDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = customerGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = customerYumenMapper.selectCount(queryWrapper);
        Integer count6 = customerSubeiMapper.selectCount(queryWrapper);
        Integer count7 = customerAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getBrowseCountByTime(String time) {
        QueryWrapper<BrowseNumberModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.apply("TO_DAYS(crt_time) >= TO_DAYS('" + time + "')");
        Integer count1 = browseNumberSuzhouMapper.selectCount(queryWrapper);
        Integer count2 = browseNumberJintaMapper.selectCount(queryWrapper);
        Integer count3 = browseNumberDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = browseNumberGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = browseNumberYumenMapper.selectCount(queryWrapper);
        Integer count6 = browseNumberSubeiMapper.selectCount(queryWrapper);
        Integer count7 = browseNumberAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public int getApplyCountByTime(String time) {
        QueryWrapper<WorkApplyModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.apply("TO_DAYS(crt_time) = TO_DAYS('" + time + "')");
        Integer count1 = workApplySuzhouMapper.selectCount(queryWrapper);
        Integer count2 = workApplyJintaMapper.selectCount(queryWrapper);
        Integer count3 = workApplyDunhuangMapper.selectCount(queryWrapper);
        Integer count4 = workApplyGuazhouMapper.selectCount(queryWrapper);
        Integer count5 = workApplyYumenMapper.selectCount(queryWrapper);
        Integer count6 = workApplySubeiMapper.selectCount(queryWrapper);
        Integer count7 = workApplyAkesaiMapper.selectCount(queryWrapper);
        return count1 + count2 + count3 + count4 + count5 + count6 + count7;
    }

    @Override
    public List<DataVo> getDataCount(String startTime, String endTime) {

        List<DataVo> list = new ArrayList<>();
        Integer suzhouBrowseCount = browseNumberSuzhouMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer suzhouWorkCount = workApplySuzhouMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo = new DataVo();
        vo.setName("肃州区");
        vo.setBrowseCount(305105 + (suzhouBrowseCount * 3));
        vo.setDeliveryCount(849 + (suzhouWorkCount * 3));
        list.add(vo);

        Integer jintaBrowseCount = browseNumberJintaMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer jintaWorkCount = workApplyJintaMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo2 = new DataVo();
        vo2.setName("金塔县");
        vo2.setBrowseCount(75291 + (jintaBrowseCount * 3));
        vo2.setDeliveryCount(272 + (jintaWorkCount * 3));
        list.add(vo2);

        Integer dunhuangBrowseCount = browseNumberDunhuangMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer dunhuangWorkCount = workApplyDunhuangMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo3 = new DataVo();
        vo3.setName("敦煌市");
        vo3.setBrowseCount(69305+(dunhuangBrowseCount*3));
        vo3.setDeliveryCount(131+(dunhuangWorkCount*3));
        list.add(vo3);

        Integer guazhouBrowseCount = browseNumberGuazhouMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer guazhouWorkCount = workApplyGuazhouMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo4 = new DataVo();
        vo4.setName("瓜州县");
        vo4.setBrowseCount(99235+(guazhouBrowseCount*3));
        vo4.setDeliveryCount(619+(guazhouWorkCount*3));
        list.add(vo4);

        Integer yumenBrowseCount = browseNumberYumenMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer yumenWorkCount = workApplyYumenMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo5 = new DataVo();
        vo5.setName("玉门市");
        vo5.setBrowseCount(64121 + (yumenBrowseCount * 3));
        vo5.setDeliveryCount(62+(yumenWorkCount*3));
        list.add(vo5);

        Integer subeiBrowseCount = browseNumberSubeiMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer subeiWorkCount = workApplySubeiMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo6 = new DataVo();
        vo6.setName("肃北县");
        vo6.setBrowseCount(11014+(subeiBrowseCount*3));
        vo6.setDeliveryCount(305+(subeiWorkCount*3));
        list.add(vo6);

        Integer akesaiBrowseCount = browseNumberAkesaiMapper.selectCount(getBrowseSql(startTime,endTime));
        Integer akesaiWorkCount = workApplyAkesaiMapper.selectCount(getWorkSql(startTime,endTime));
        DataVo vo7 = new DataVo();
        vo7.setName("阿克塞县");
        vo7.setBrowseCount(5982+(akesaiBrowseCount*3));
        vo7.setDeliveryCount(165+(akesaiWorkCount)*3);
        list.add(vo7);

        return list;
    }

    public QueryWrapper<BrowseNumberModel> getBrowseSql(String startTime,String endTime){
        QueryWrapper<BrowseNumberModel> queryWrapper = new QueryWrapper<>();
        if(StringTool.isNotEmpty(startTime))
        {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('"+startTime+"')");
        }else{
            queryWrapper.apply(" TO_DAYS(crt_time) > TO_DAYS('2023-07-14 00:00:00')");
        }
        if(StringTool.isNotEmpty(endTime))
        {
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('"+endTime+"')");
        }

        queryWrapper.select().orderByDesc("id");
        return queryWrapper;
    }
    public QueryWrapper<WorkApplyModel> getWorkSql(String startTime,String endTime){
        QueryWrapper<WorkApplyModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("distinct publish_id");
        if(StringTool.isNotEmpty(startTime))
        {
            queryWrapper.apply(" TO_DAYS(crt_time) >= TO_DAYS('"+startTime+"')");
        }
        if(StringTool.isNotEmpty(endTime))
        {
            queryWrapper.apply(" TO_DAYS(crt_time) <= TO_DAYS('"+endTime+"')");
        }

        return queryWrapper;
    }

}
